Changing DBE parameters during script execution - is it possible?

Hi,
Like in subject - is it somehow possible?
I'm trying having similar effect like it is realized in Filter for Attributes (e.g.) for standard filter configuration in Doors for any module. It comes on possibility to modify choice element from read only to user editable.
My assumption was to change optional "bool canEdit" parameter from false to true like below:
dbeValueList = choice(dbMainWin, "", valueString, 0, 50, false )
dbeValueList = choice(dbMainWin, "", valueString, 0, 50, true )
any ideas?
And related question:
Maybe there is some include file which provides Filter configuration as this one available in Doors? similar to fnminiExplorer
Thanks in advance for any help.
SystemAdmin - Mon Mar 30 10:36:26 EDT 2009

Re: Changing DBE parameters during script execution - is it possible?
dpechacek - Mon Mar 30 13:24:36 EDT 2009

I do not believe you can make the change you show in your example.

You can however set certain things as inactive/active which might help you achieve the same thing.

AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Re: Changing DBE parameters during script execution - is it possible?
llandale - Mon Mar 30 13:57:50 EDT 2009

Not really following what you are getting at. Yes, you can modify a DBE variable on the fly as perhaps you want to call a generic function that can work on any one of several similar DBEs on your dialog box.

No, you cannot easily change the value of a DBE on a particular Dialog Box, perhaps start it as a 'label' and later change it to a 'field'. Guess I've never actually tried it, realize and display the dialog and later add an Element... You can however defined two DBEs, one on top of the other, of types 'label' and of type 'field', and have a function that figures out which one to 'show' and which one to 'hide'; and another function that figures out which one to read or set.

>Louie

Re: Changing DBE parameters during script execution - is it possible?
djakad - Mon Mar 30 15:14:02 EDT 2009

You cannot change the canEdit status of a choice, once it is realized. The canEdit option gives the ability to enter a choice which is not in the dropdown.

You can change the read-only/read-write status of fields and text boxes with set(DBE,true/false)

As was mentioned, you can use inactive(DBE) and active(DBE) to grey-out and re-activate any DBE.

Also as was mentioned, you can use hide(DBE) and show(DBE) to make certain DBEs available to the user only when desired.

You cannot swap one DBE for another DBE once the dialog box is realized. For example, you cannot do this:

dbMainWin = centered("Sample DB:)
dbeValueList1 = choice(dbMainWin, "", valueString, 0, 50, false )
dbeValueList2 = choice(dbMainWin, "", valueString, 0, 50, true )
realize(dbMainWin)
dbeValueList2=dbeValueList1 // Generally, you run into problems trying to use DBEs as normal variables
show(dbMainWin)

Re: Changing DBE parameters during script execution - is it possible?
dpechacek - Mon Mar 30 15:23:27 EDT 2009

djakad - Mon Mar 30 15:14:02 EDT 2009
You cannot change the canEdit status of a choice, once it is realized. The canEdit option gives the ability to enter a choice which is not in the dropdown.

You can change the read-only/read-write status of fields and text boxes with set(DBE,true/false)

As was mentioned, you can use inactive(DBE) and active(DBE) to grey-out and re-activate any DBE.

Also as was mentioned, you can use hide(DBE) and show(DBE) to make certain DBEs available to the user only when desired.

You cannot swap one DBE for another DBE once the dialog box is realized. For example, you cannot do this:

dbMainWin = centered("Sample DB:)
dbeValueList1 = choice(dbMainWin, "", valueString, 0, 50, false )
dbeValueList2 = choice(dbMainWin, "", valueString, 0, 50, true )
realize(dbMainWin)
dbeValueList2=dbeValueList1 // Generally, you run into problems trying to use DBEs as normal variables
show(dbMainWin)

Thank you David for clarification.

AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Re: Changing DBE parameters during script execution - is it possible?
SystemAdmin - Tue Mar 31 03:33:22 EDT 2009

dpechacek - Mon Mar 30 15:23:27 EDT 2009
Thank you David for clarification.

AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

How about adding new DBE:s to a realized dialog box?
For example, a dialog box taking information from the curent object and, depending on the amount of linked object, showing (and being able to edit) the information from the linked objects in DBE:s, as well as being able to add new objects to link to the current object...
Yes, you can create a "pool" of DBE:s and populate them with the information and hiding those that are not needed, but that will put a limit on the amount of information that can be show - which is not so nice! I guess you could add a 'more' button which will update the info with the next set of informtion etc, but I like it dynamic and with as few limitations as possible. Also the need for scrollbars shows up... Is there a way to create a scrollbar for a DB?

Re: Changing DBE parameters during script execution - is it possible?
dpechacek - Tue Mar 31 07:32:52 EDT 2009

SystemAdmin - Tue Mar 31 03:33:22 EDT 2009
How about adding new DBE:s to a realized dialog box?
For example, a dialog box taking information from the curent object and, depending on the amount of linked object, showing (and being able to edit) the information from the linked objects in DBE:s, as well as being able to add new objects to link to the current object...
Yes, you can create a "pool" of DBE:s and populate them with the information and hiding those that are not needed, but that will put a limit on the amount of information that can be show - which is not so nice! I guess you could add a 'more' button which will update the info with the next set of informtion etc, but I like it dynamic and with as few limitations as possible. Also the need for scrollbars shows up... Is there a way to create a scrollbar for a DB?

Once a dialog box is realized, you can't add any new DBEs to it. That's why my Dynamic Dialog Box script took so long. Of course screen size helped contain how large it could be. See the script on Kevin Murphy's site if you're interested. www.baselinesinc.com

"I like it dynamic and with as few limitations as possible."

You'll get used to lacking these things eventually.

AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com

Re: Changing DBE parameters during script execution - is it possible?
SystemAdmin - Tue Mar 31 07:44:38 EDT 2009

llandale - Mon Mar 30 13:57:50 EDT 2009
Not really following what you are getting at. Yes, you can modify a DBE variable on the fly as perhaps you want to call a generic function that can work on any one of several similar DBEs on your dialog box.

No, you cannot easily change the value of a DBE on a particular Dialog Box, perhaps start it as a 'label' and later change it to a 'field'. Guess I've never actually tried it, realize and display the dialog and later add an Element... You can however defined two DBEs, one on top of the other, of types 'label' and of type 'field', and have a function that figures out which one to 'show' and which one to 'hide'; and another function that figures out which one to read or set.

>Louie

Thank you All for support.
I did it like proposed by llandale and also ensure what is possible.
In fact I've tried to do this in that way that the same variable was re-assigned with other parameters e.g.:
dbeValueList = choice(dbMainWin, "", valueString, 0, 50, false)
and then (when change desired)
dbeValueList = choice(dbMainWin, "", valueString, 0, 50, true)
but of course it doesn't work because it was called after show - even if I used it in Callback from DBE
Using combination:
dbeValueListRO = choice(dbMainWin, "", valueString, 0, 50, false)
dbeValueListRW = choice(dbMainWin, "", valueString, 0, 50, true)
hide(dbeValueListRW)
and then if RW was required
hide(dbeValueListRO)
show(dbeValueListRW)
desired effect was met. I think right now for choice DBE it is the only way to make it.
In addition I've defined global dbeFilterListHandler which by using:
dbeValueListHandler= dbeValueListRO
or
dbeValueListHandler = dbeValueListRW
lets me get an easy access to actual value of displayed DBE from any place of script by using:
get(dbeValueListHandler)
That's nice...
Best regards

Re: Changing DBE parameters during script execution - is it possible?
llandale - Tue Mar 31 10:53:00 EDT 2009

djakad - Mon Mar 30 15:14:02 EDT 2009
You cannot change the canEdit status of a choice, once it is realized. The canEdit option gives the ability to enter a choice which is not in the dropdown.

You can change the read-only/read-write status of fields and text boxes with set(DBE,true/false)

As was mentioned, you can use inactive(DBE) and active(DBE) to grey-out and re-activate any DBE.

Also as was mentioned, you can use hide(DBE) and show(DBE) to make certain DBEs available to the user only when desired.

You cannot swap one DBE for another DBE once the dialog box is realized. For example, you cannot do this:

dbMainWin = centered("Sample DB:)
dbeValueList1 = choice(dbMainWin, "", valueString, 0, 50, false )
dbeValueList2 = choice(dbMainWin, "", valueString, 0, 50, true )
realize(dbMainWin)
dbeValueList2=dbeValueList1 // Generally, you run into problems trying to use DBEs as normal variables
show(dbMainWin)

This sequence: "Skip skp = create(); skp = null" doesn't erase the created Skip list, it just makes it inaccisble and it will persist for the duration of the DXL execution.

Just a nit-pick, but you can indeed do your code above, but it won't have the implied desired effect. Assigning DBE variables has no effect on the dialog box; so in your example by assigning dbeValueList2 = 1 you have lost the ability to read and write to the 2nd choice DBE. Instead of assigning 2 = 1 you can create a new DBE variable, perhaps "DBE dbeCurrentActiveChoice" and assign it to 1 or 2 as needed. That doesn't create any new choice on the Box, but just gives another handle to what you are doing.

> Louie

Actually, you CAN get to the 2nd choice DBE if you've assigned a callback function to it, since that function's input DBE parameter will be the one changed.